var Promise  = require('bluebird');
var bidList    = require('../models/bidList');
var using = Promise.using;

function h5home(){
  return bidList.h5home("req.postbody.auth")
    .then(function(result){
      if(typeof result !== 'object') result = JSON.parse(result)
      if(result && result.body){
        result = result.body; 
        if(typeof result !== 'object') result = JSON.parse(result)
        return result; 
      }else{
        return {}
      }
    }
  )
}

module.exports ={
  list : function(cb){
    return using(
      h5home(),
      cb
    )
  }
}